Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\cubes>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 80
Server version: 5.5.27 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show daatabases;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'daata
bases' at line 1
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| performance_schema |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> USE `mb125`;
Database changed
mysql> SHOW TABLES;
Empty set (0.00 sec)

mysql> CREATE TABLE `users`(
    -> `id` INT AUTO_INCREMENT,
    -> `name` VARCHAR(80),
    -> `email` VARCHAR(80),
    -> `created_date` DATETIME,
    -> `modify_date` TIMESTAMP,
    -> `status`ENUM('0','1')
    -> );
ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum
n and it must be defined as a key
mysql> CREATE TABLE `users`(
    -> `id` INT AUTO_INCREMENT,
    -> `name` VARCHAR(80),
    -> `email` VARCHAR(80),
    -> `created_date` DATETIME,
    -> `status`ENUM('0','1')
    -> PRIMARY KEY(`id`)
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(`id`
)
)' at line 7
mysql> CREATE TABLE `users`(
    -> `id` INT AUTO_INCREMENT PRIMARY KEY,
    -> `name` VARCHAR(80),
    -> `email` VARCHAR(80),
    -> `created_date` DATETIME,
    -> `modify_date` TIMESTAMP,
    -> `status`ENUM('0','1')
    -> );
Query OK, 0 rows affected (0.16 sec)

mysql> DESC `users`;
+--------------+---------------+------+-----+-------------------+---------------
--------------+
| Field        | Type          | Null | Key | Default           | Extra
              |
+--------------+---------------+------+-----+-------------------+---------------
--------------+
| id           | int(11)       | NO   | PRI | NULL              | auto_increment
              |
| name         | varchar(80)   | YES  |     | NULL              |
              |
| email        | varchar(80)   | YES  |     | NULL              |
              |
| created_date | datetime      | YES  |     | NULL              |
              |
| modify_date  | timestamp     | NO   |     | CURRENT_TIMESTAMP | on update CURR
ENT_TIMESTAMP |
| status       | enum('0','1') | YES  |     | NULL              |
              |
+--------------+---------------+------+-----+-------------------+---------------
--------------+
6 rows in set (1.70 sec)

mysql> INSERT into `users`
    -> VALUES
    -> (null,'php','php@zend.com',NOW(),null,'1');
Query OK, 1 row affected (1.75 sec)

mysql> SELECT * FROM `users`;
+----+------+--------------+---------------------+---------------------+--------
+
| id | name | email        | created_date        | modify_date         | status
|
+----+------+--------------+---------------------+---------------------+--------
+
|  1 | php  | php@zend.com | 2013-08-24 11:11:27 | 2013-08-24 11:11:27 | 1
|
+----+------+--------------+---------------------+---------------------+--------
+
1 row in set (0.00 sec)

mysql> INSERT INTO `users`(`name`,`email`,`created_date`,`status`)
    -> VALUES
    -> ('Rasmus','rasmus@zend.com',NOW(),'0');
Query OK, 1 row affected (0.09 sec)

mysql> INSERT INTO `users` SET
    -> `name`='vikas',
    -> `email`='vikas@gmail.com',
    -> `created_date`= NOW(),
    -> `status`='1';
Query OK, 1 row affected (0.13 sec)

mysql> SELECT * FROM `users`;
+----+--------+-----------------+---------------------+---------------------+---
-----+
| id | name   | email           | created_date        | modify_date         | st
atus |
+----+--------+-----------------+---------------------+---------------------+---
-----+
|  1 | php    | php@zend.com    | 2013-08-24 11:11:27 | 2013-08-24 11:11:27 | 1
     |
|  2 | Rasmus | rasmus@zend.com | 2013-08-24 11:16:15 | 2013-08-24 11:16:15 | 0
     |
|  3 | vikas  | vikas@gmail.com | 2013-08-24 11:18:05 | 2013-08-24 11:18:05 | 1
     |
+----+--------+-----------------+---------------------+---------------------+---
-----+
3 rows in set (0.00 sec)

mysql> UPDATE `users` SET `name`='Zeev' WHERE `id`=2;
Query OK, 1 row affected (0.07 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM `users`;
+----+-------+-----------------+---------------------+---------------------+----
----+
| id | name  | email           | created_date        | modify_date         | sta
tus |
+----+-------+-----------------+---------------------+---------------------+----
----+
|  1 | php   | php@zend.com    | 2013-08-24 11:11:27 | 2013-08-24 11:11:27 | 1
    |
|  2 | Zeev  | rasmus@zend.com | 2013-08-24 11:16:15 | 2013-08-24 11:24:10 | 0
    |
|  3 | vikas | vikas@gmail.com | 2013-08-24 11:18:05 | 2013-08-24 11:18:05 | 1
    |
+----+-------+-----------------+---------------------+---------------------+----
----+
3 rows in set (0.00 sec)

mysql> DELETE FROM `users` WHERE `id`=1;
Query OK, 1 row affected (0.08 sec)

mysql> SELECT * FROM `users`;
+----+-------+-----------------+---------------------+---------------------+----
----+
| id | name  | email           | created_date        | modify_date         | sta
tus |
+----+-------+-----------------+---------------------+---------------------+----
----+
|  2 | Zeev  | rasmus@zend.com | 2013-08-24 11:16:15 | 2013-08-24 11:24:10 | 0
    |
|  3 | vikas | vikas@gmail.com | 2013-08-24 11:18:05 | 2013-08-24 11:18:05 | 1
    |
+----+-------+-----------------+---------------------+---------------------+----
----+
2 rows in set (0.06 sec)

mysql> DELETE FROM `users`;
Query OK, 2 rows affected (0.09 sec)

mysql>
